var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');



var app = getApp();

Page({
  data: {
    couponList:[]
  },
  onLoad: function (options) {
    this.getData();
  },
  getData(){
    let that= this;
    util.request(api.MyCoupon, { token: wx.getStorageSync("token") }).then(function (res) {
      if(res.code==='200'){
        that.setData({
          couponList:res.datas
        })
      }
    });
  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {
    // 页面隐藏

  },
  onUnload: function () {
    // 页面关闭
  },
  fnGo:function(e){
    wx.switchTab({
      url: '/pages/index/index-new',
    })
  }
})